hysop.backend.device.opencl.opencl_buffer module

class hysop.backend.device.opencl.opencl_buffer.OpenClBuffer(self: pyopencl._cl.Buffer, context: pyopencl._cl.Context, flags: int, size: int = 0, hostbuf: object = None)[source]

Bases: DeviceBuffer, Buffer

OpenCL buffer object. Simple wrapper of a pyopencl.Buffer.

aligned_view(alignment, size=None)[source]

Return a view of this buffer with an offset such that the returned buffer is now aligned on min_alignment and has now given size.

get_int_ptr()[source]
ref_count()[source]
release()[source]

Release this buffer (decrease internal implementation defined reference counter).

class hysop.backend.device.opencl.opencl_buffer.OpenClPooledBuffer(*args, **kwds)[source]

Bases: PooledBuffer, MemoryObjectHolder

Create a memory pool wrapped buffer. Input buffer buf was allocated by given pool with real size alloc_sz. Buffer is resized and aligned to given size and alignment. On destruction, buffer will be given back to the pool.

get_ptr()[source]
property ptr